package com.dongdongshop.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dongdongshop.em.ConstantEnum;
import com.dongdongshop.pojo.StatusCode;
import com.dongdongshop.pojo.TbContent;
import com.dongdongshop.service.ContentService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("content")
public class ContentController {
    @Reference
    private ContentService contentService;
    @RequestMapping("selectContent")
    @ResponseBody
    public StatusCode selectContent(Long categoryId){
        List<TbContent> list = contentService.selectContentDesc(categoryId);
        return StatusCode.build(ConstantEnum.SUCCESS).setT(list);
    }
}
